<!-- Message Error -->
<?php if ($this->session->flashdata('f_purchase')): ?>
    <div class="msg msg-ok boxwidth">
        <p><strong><?php echo $this->session->flashdata('f_purchase'); ?></strong></p>
    </div>
<?php endif; ?>


<!-- Box -->
<div class="box">
    <!-- Box Head -->
    <div class="box-head">
        <div class="right">
            <form action="<?php echo base_url();?>admin/purchase/search" method="post">
                <label>search purchase</label>
                <input type="text" class="field small-field" name="purchase_name"/>
                <input type="submit" class="button" value="search" />
            </form>
        </div>
    </div>
    <!-- End Box Head -->	

    <!-- Table -->
    <div class="table">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <th>ID</th>
                <th>Name</th>
                <th>State</th>
                <th>Country</th>
                <th>Phone</th>
                <th>Email</th>
                <th>Date Added/Modifed</th>
                <th width="110" class="ac">Control</th>
            </tr>
            <?php $i=0;?>
            <?php foreach($purchase->result() as $p):?>
            <tr <?php echo (($i++%2)!=0)?'class="odd"':'';?>>
                <td class="column_id"><?php echo $p->id;?></td>
                <td><h3><a class="column_edit" title="See details of this item" href="<?php echo base_url();?>admin/purchase/view/<?php echo $p->id;?>"><?php echo $p->last_name.', '.$p->first_name;?></a></h3></td>
                <td><?php echo $p->state;?></td>
                <td><?php echo $p->country;?></td>
                <td><?php echo $p->phone;?></td>
                <td><?php echo $p->email;?></td>
                <td><?php echo $p->modified_date;?></td>
                <td class="center">
                    <a href="<?php echo base_url();?>admin/purchase/delete/<?php echo $p->id;?>" class="ico del column_delete">Delete</a>
                </td>
            </tr>
            <?php endforeach;?>
        </table>
        <!-- Pagging -->
        <div class="pagging">
            <div class="left">
                Showing <?php echo $start+1;?>-<?php echo $start+$purchase->num_rows();?> of <?php echo $count;?>
            </div>
            <div class="right">
                <a href="#">Previous</a>
                <a href="#">Next</a>
            </div>
        </div>
        <!-- End Pagging -->

    </div>
    <!-- Table -->

</div>
<!-- End Box -->